package com.wyy.travels.dao;/*
 **
 * @author yangyang
 *@date 2022/07/19 22:04
 **/

import com.wyy.travels.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

@Mapper
public interface UserDao {
    @Insert("insert into t_user values(#{id},#{username},#{password},#{email})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void  save(User user);

    @Select("select * from t_user where username=#{username}")
    User findByUsername(String username);


}
